Optimal. Leaf size=68 \[ -\frac {\sqrt {d^2-e^2 x^2}}{x}+e \tan ^{-1}\left (\frac {e x}{\sqrt {d^2-e^2 x^2}}\right )-2 e \tanh ^{-1}\left (\frac {\sqrt {d^2-e^2 x^2}}{d}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 68, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.259, Rules used = {1821, 858, 223,
209, 272, 65, 214} \begin {gather*} e \text {ArcTan}\left (\frac {e x}{\sqrt {d^2-e^2 x^2}}\right )-\frac {\sqrt {d^2-e^2 x^2}}{x}-2 e \tanh ^{-1}\left (\frac {\sqrt {d^2-e^2 x^2}}{d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 209
Rule 214
Rule 223
Rule 272
Rule 858
Rule 1821
Rubi steps
\begin {align*} \int \frac {(d+e x)^2}{x^2 \sqrt {d^2-e^2 x^2}} \, dx &=-\frac {\sqrt {d^2-e^2 x^2}}{x}-\frac {\int \frac {-2 d^3 e-d^2 e^2 x}{x \sqrt {d^2-e^2 x^2}} \, dx}{d^2}\\ &=-\frac {\sqrt {d^2-e^2 x^2}}{x}+(2 d e) \int \frac {1}{x \sqrt {d^2-e^2 x^2}} \, dx+e^2 \int \frac {1}{\sqrt {d^2-e^2 x^2}} \, dx\\ &=-\frac {\sqrt {d^2-e^2 x^2}}{x}+(d e) \text {Subst}\left (\int \frac {1}{x \sqrt {d^2-e^2 x}} \, dx,x,x^2\right )+e^2 \text {Subst}\left (\int \frac {1}{1+e^2 x^2} \, dx,x,\frac {x}{\sqrt {d^2-e^2 x^2}}\right )\\ &=-\frac {\sqrt {d^2-e^2 x^2}}{x}+e \tan ^{-1}\left (\frac {e x}{\sqrt {d^2-e^2 x^2}}\right )-\frac {(2 d) \text {Subst}\left (\int \frac {1}{\frac {d^2}{e^2}-\frac {x^2}{e^2}} \, dx,x,\sqrt {d^2-e^2 x^2}\right )}{e}\\ &=-\frac {\sqrt {d^2-e^2 x^2}}{x}+e \tan ^{-1}\left (\frac {e x}{\sqrt {d^2-e^2 x^2}}\right )-2 e \tanh ^{-1}\left (\frac {\sqrt {d^2-e^2 x^2}}{d}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 102, normalized size = 1.50 \begin {gather*} -\frac {\sqrt {d^2-e^2 x^2}}{x}+4 e \tanh ^{-1}\left (\frac {\sqrt {-e^2} x}{d}-\frac {\sqrt {d^2-e^2 x^2}}{d}\right )+\sqrt {-e^2} \log \left (-\sqrt {-e^2} x+\sqrt {d^2-e^2 x^2}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 93, normalized size = 1.37
method | result | size |
default | \(\frac {e^{2} \arctan \left (\frac {\sqrt {e^{2}}\, x}{\sqrt {-e^{2} x^{2}+d^{2}}}\right )}{\sqrt {e^{2}}}-\frac {\sqrt {-e^{2} x^{2}+d^{2}}}{x}-\frac {2 d e \ln \left (\frac {2 d^{2}+2 \sqrt {d^{2}}\, \sqrt {-e^{2} x^{2}+d^{2}}}{x}\right )}{\sqrt {d^{2}}}\) | \(93\) |
risch | \(\frac {e^{2} \arctan \left (\frac {\sqrt {e^{2}}\, x}{\sqrt {-e^{2} x^{2}+d^{2}}}\right )}{\sqrt {e^{2}}}-\frac {\sqrt {-e^{2} x^{2}+d^{2}}}{x}-\frac {2 d e \ln \left (\frac {2 d^{2}+2 \sqrt {d^{2}}\, \sqrt {-e^{2} x^{2}+d^{2}}}{x}\right )}{\sqrt {d^{2}}}\) | \(93\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.48, size = 65, normalized size = 0.96 \begin {gather*} \arcsin \left (\frac {x e}{d}\right ) e - 2 \, e \log \left (\frac {2 \, d^{2}}{{\left | x \right |}} + \frac {2 \, \sqrt {-x^{2} e^{2} + d^{2}} d}{{\left | x \right |}}\right ) - \frac {\sqrt {-x^{2} e^{2} + d^{2}}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.21, size = 77, normalized size = 1.13 \begin {gather*} -\frac {2 \, x \arctan \left (-\frac {{\left (d - \sqrt {-x^{2} e^{2} + d^{2}}\right )} e^{\left (-1\right )}}{x}\right ) e - 2 \, x e \log \left (-\frac {d - \sqrt {-x^{2} e^{2} + d^{2}}}{x}\right ) + \sqrt {-x^{2} e^{2} + d^{2}}}{x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.79, size = 207, normalized size = 3.04 \begin {gather*} d^{2} \left (\begin {cases} - \frac {e \sqrt {\frac {d^{2}}{e^{2} x^{2}} - 1}}{d^{2}} & \text {for}\: \left |{\frac {d^{2}}{e^{2} x^{2}}}\right | > 1 \\- \frac {i e \sqrt {- \frac {d^{2}}{e^{2} x^{2}} + 1}}{d^{2}} & \text {otherwise} \end {cases}\right ) + 2 d e \left (\begin {cases} - \frac {\operatorname {acosh}{\left (\frac {d}{e x} \right )}}{d} & \text {for}\: \left |{\frac {d^{2}}{e^{2} x^{2}}}\right | > 1 \\\frac {i \operatorname {asin}{\left (\frac {d}{e x} \right )}}{d} & \text {otherwise} \end {cases}\right ) + e^{2} \left (\begin {cases} \frac {\sqrt {\frac {d^{2}}{e^{2}}} \operatorname {asin}{\left (x \sqrt {\frac {e^{2}}{d^{2}}} \right )}}{\sqrt {d^{2}}} & \text {for}\: d^{2} > 0 \wedge e^{2} > 0 \\\frac {\sqrt {- \frac {d^{2}}{e^{2}}} \operatorname {asinh}{\left (x \sqrt {- \frac {e^{2}}{d^{2}}} \right )}}{\sqrt {d^{2}}} & \text {for}\: d^{2} > 0 \wedge e^{2} < 0 \\\frac {\sqrt {\frac {d^{2}}{e^{2}}} \operatorname {acosh}{\left (x \sqrt {\frac {e^{2}}{d^{2}}} \right )}}{\sqrt {- d^{2}}} & \text {for}\: d^{2} < 0 \wedge e^{2} < 0 \end {cases}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 1.05, size = 107, normalized size = 1.57 \begin {gather*} \arcsin \left (\frac {x e}{d}\right ) e \mathrm {sgn}\left (d\right ) - 2 \, e \log \left (\frac {{\left | -2 \, d e - 2 \, \sqrt {-x^{2} e^{2} + d^{2}} e \right |} e^{\left (-2\right )}}{2 \, {\left | x \right |}}\right ) + \frac {x e^{3}}{2 \, {\left (d e + \sqrt {-x^{2} e^{2} + d^{2}} e\right )}} - \frac {{\left (d e + \sqrt {-x^{2} e^{2} + d^{2}} e\right )} e^{\left (-1\right )}}{2 \, x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \left \{\begin {array}{cl} \frac {e^2\,\ln \left (x\,\sqrt {-e^2}+\sqrt {d^2-e^2\,x^2}\right )}{\sqrt {-e^2}}-\frac {\sqrt {d^2-e^2\,x^2}}{x}-\frac {2\,d\,e\,\ln \left (\frac {\sqrt {d^2}+\sqrt {d^2-e^2\,x^2}}{x}\right )}{\sqrt {d^2}} & \text {\ if\ \ }e^2<0\\ \int \frac {e^2}{\sqrt {d^2-e^2\,x^2}}+\frac {d^2}{x^2\,\sqrt {d^2-e^2\,x^2}}+\frac {2\,d\,e}{x\,\sqrt {d^2-e^2\,x^2}} \,d x & \text {\ if\ \ }\neg e^2<0 \end {array}\right . \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________